import com.jeff.work.MyProcess;
import com.jeff.work.Scheduler;

import java.util.Scanner;

public class ProcessScheduleTest {
    public static void main(String[] args) {
        Scheduler scheduler = new Scheduler();

        // 添加进程
        scheduler.addProcess(new MyProcess("P1", 3, 0, 10, 0));
        scheduler.addProcess(new MyProcess("P2", 1, 2, 5, 0));
        scheduler.addProcess(new MyProcess("P3", 2, 4, 8, 0));

        // 最高优先级优先调度
        scheduler.highestPriorityFirst();
        // 先进先出调度
        scheduler.firstComeFirstServe();

        // 时间片轮转调度
        System.out.println("请输入时间片大小");
        Scanner sc = new Scanner(System.in);
        int timeSlice = sc.nextInt();


        scheduler.roundRobin(timeSlice);
    }

}